function getCookie(cookieName) {
    var strCookie = document.cookie;
    var arrCookie = strCookie.split(";");
    for (var i = 0;i < arrCookie.length;i++) {
        // cookie形如 key=value 使用 '=' 进行分割
        var arr = arrCookie[i].split("=");
        if (cookieName == arr[0]) {
            return arr[1];
        }
        return "";
    }
}

$.fn.serializeFormJSON=function(){
    var o={};
    var a=this.serializeArray();
    $.each(a,function(){
        if(o[this.name]){
            if(!o[this.name].push){
                o[this.name]=[o[this.name]];
            }
            o[this.name].push(this.value||'');
        }else{
            o[this.name]=this.value||'';
        }
    });
    return o;
};